package com.sprouting.ops.model;

import com.sprouting.ops.annotations.invoke.CheckIsNullOrEmpty;
import com.sprouting.ops.annotations.invoke.CheckLength;
import com.sprouting.ops.annotations.invoke.CheckNotNull;
import com.sprouting.ops.interfaces.AddGroup;
import com.sprouting.ops.interfaces.UpdGroup;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * (组件版本信息表)表实体类
 *
 * @author longx
 * @since 2023-11-25 18:39:34
 */
@Data
@TableName("ops_component_version")
public class OpsComponentVersion extends BaseModel {

    /**
     * 主键
     */
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @CheckIsNullOrEmpty(message = "无效ID", groups = AddGroup.class)
    @TableId
    private String id;
    /**
     * 隶属组件
     * @see OpsComponent#getId()
     */
    @CheckNotNull(message = "请选择组件")
    private String componentId;
    /**
     * 组件版本，不用加v开头
     */
    @CheckLength(min = 1, max = 20, message = "组件版本超过长度限制")
    @CheckNotNull(message = "请输入组件版本")
    private String version;
    /**
     * 版本类型
     * @see com.sprouting.ops.interfaces.ConstantBase.ComponentVersionType
     */
    @NotNull(message = "请选择版本类型")
    private Integer type;
    /**
     * 类型说明，推荐原因和禁用原因
     */
    @CheckLength(max = 2000, message = "类型说明超过长度限制")
    private String reason;
    /**
     * 版本简介，版本信息，新特性等
     */
    @CheckLength(min = 1, max = 2000, message = "组件介绍超过长度限制")
    // @CheckNotNull(message = "请输入组件介绍")
    private String briefIntroduction;
    /**
     * 下载组件地址-附件地址
     */
    @CheckLength(max = 1000, message = "附件地址超过长度限制")
    private String downUrl;
    /**
     * 安装步骤
     */
    private String installDoc;
    /**
     * 启动步骤
     */
    private String start;
    /**
     * 停止步骤
     */
    private String stop;
    /**
     * 备注
     */
    @CheckLength(max = 2000, message = "备注过长度限制")
    private String description;

}

